<template>
	<view>
		<uv-navbar
			:leftIconColor="navstyle.txtColor"
			:titleStyle="titleStyle"
			:title="navstyle.title"
			:leftIcon="navstyle.leftIcon"
			:bgColor="navstyle.bgColor"
			:fixed="false" 
			@leftClick="leftClick"
			:safeAreaInsetTop="false">
		</uv-navbar>
		<view class="order_tab">
			<uv-tabs 
			lineWidth="32" 
			lineHeight="2"
			lineColor="#f56c6c" 
			:activeStyle="{
				color: '#303133',
			}" 
			itemStyle="flex:1;font-size:16px"
			:list="list" @click="tabClick(item)"></uv-tabs>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				navstyle: {
					title: "我的订单",
					txtColor: "#333333",
					bgColor: "#FFFFFF",
					leftIcon: "arrow-left",
				},
				titleStyle: {
					fontWeight: 700
				},
				current: 0,
				list: [{
						state: "0",
						name: "全部",
						value: "all"
					},
					{
						state: "1",
						name: "待发货",
						value: "shipped"
					},
					{
						state: "2",
						name: "待收货",
						value: "received"
					},
					{
						state: "3",
						name: "已完成",
						value: "finished"
					}
				]


			}
		},
		onLoad: function(e) {
			console.log(e),
				"all" == e.type ? this.current = 0 : "shipped" == e.type ? this.current = 1 : "received" == e.type ?
				this.current = 2 : "finished" == e.type && (this.current = 3)
		},
		methods: {
			leftClick: function() {
				uni.reLaunch({
				  url: '/pages/index/user' // 替换成上一页的路径
				});
			},
			screenEvent: function(e) {
				console.log(e)
			},
			tabClick(item) {

			},
		}

	}
</script>

<style>
	.page {
		width: 100%;
		height: 100%;
		background-color: #fafafa;
	}

	.order_tab {
		display: flex;
		justify-content: space-between;
		padding: 8px 0;
		font-size: 16px;
		line-height: 35px;
	}

	.uv-tabs {
		width: 100% !important;
	}
</style>